﻿using System;

namespace EasyConveyor
{
	/// <summary>
	/// Provides data for the <see cref="Application.RequestCompleted"/> event.
	/// </summary>
	public sealed class RequestCompletedEventArgs : EventArgs
	{
		internal RequestCompletedEventArgs(ActivatorBase activator, object context, bool completedPipeline)
		{
			Activator = activator;
			Context = context;
			CompletedPipeline = completedPipeline;
		}

		/// <summary>
		/// Gets the instance of the activator that activated the completed request.
		/// </summary>
		public ActivatorBase Activator { get; private set; }
		/// <summary>
		/// Gets the context associated with the completed request.
		/// </summary>
		public object Context { get; private set; }
		/// <summary>
		/// Gets a <see cref="bool"/> indicating whether each middleware in the pipeline was completed or not. True if every middleware was executed or false if the request processing was prematurely terminated by a middleware.
		/// </summary>
		public bool CompletedPipeline { get; private set; }
	}
}
